/*
 * @Author: Ylong
 * @Date: 2025-07-14 16:03:28
 * @LastEditTime: 2025-07-24 23:30:49
 */
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import autoprefixer from "autoprefixer";
import { resolve } from "path";

// https://vite.dev/config/
export default defineConfig({
  root: process.cwd(),
  base: "./",
  server: {
    host: "0.0.0.0",
    port: 5180,
    proxy: {
      "/api": {
        target: "https://buddy-meow.com/buddymeow/",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
  },
  plugins: [vue()],
  css: {
    postcss: {
      plugins: [autoprefixer()],
    },
  },
});
